#pragma once
#include <game/Config.h>

#include <string>
#include <memory>
#include <map>

#include <boost/function.hpp>

ARELLO_GAME_NAMESPACE_DECL_START
namespace flow {
	
class Selector;
typedef boost::function<std::auto_ptr<Selector> ()> SelectorCreator;

class SelectorFactory
{
public:
	SelectorFactory();
	SelectorFactory(const SelectorFactory& rhs);
	~SelectorFactory();

	const SelectorFactory& operator=(const SelectorFactory& rhs);

	void Register(const std::string& name, SelectorCreator creator);
	std::auto_ptr<Selector> Create(const std::string& name) const;
private:
	std::map<std::string, SelectorCreator> selectors;
};

} // namespace flow
ARELLO_GAME_NAMESPACE_DECL_END